package hihocoder;
import java.util.Scanner;

/**
 * 
 */

/**
 * @author zhongfang
 *
 */
public class TreeRestoration {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int N=scanner.nextInt();
		int M=scanner.nextInt();
		int K=scanner.nextInt();
		int[] A=new int[M];
		for (int i = 0; i < M; i++) {
			A[i]=scanner.nextInt();
		}
		int[][] B=new int[M][];
		for (int i = 0; i < M; i++) {
			for (int j = 0; j < A[i]; j++) {
				B[i][j]=scanner.nextInt();
			}
		}
		for (int i = 0; i < K; i++) {
			
		}
	}

}
